Second quiz: October 14 (Tuesday)
Exam I: October 21st (Tuesday)

"Practice makes perfect"

- Built-in data structures: 
Collection (Interface)
Child interfaces: List, Set, Queue (FIFO)
Map is not derived from Collection

- List is implemented by: ArrayList + LinkedList
ArrayList uses a dynamic array to store the values
LinkedList uses a doubly linked list to hold the values

An interface is also known as Abstract Data Type 

Example#1: Linked List Demo

Iterator is the parent interface of ListIterator 

- Set: 
HashSet and TreeSet implement the Set interface
HashSet vs. TreeSet: elements are sorted


Second smallest value in an array: 
Arrays.sort(arr); // O(nlog2(n))
arr[1]

Solve it in linear time. The time complexity of your solution should be O(n)

Example#2: Removing Duplicates

- Map (Dictionary)
Collection of key/value pairs
HashMap and TreeMap implement the Map interface ==> In a treemap, keys are sorted
Keys in a map are unique

Word: count

the quick brown fox jumps over the lazy dog

the: 2 (entry)

If I am encountering the word for the first, I am going to insert an entry into the map: 
text: 1























